package com.example.steel.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.view.WindowManager;

public class MainActivity extends AppCompatActivity {
    private WebView webView;
    private ProgressBar progressBar;
    private WebSettings WebSettings;
    private WebChromeClient webChromeClient;
    private WebViewClient webViewClient;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,WindowManager.LayoutParams. FLAG_FULLSCREEN);
        progressBar= (ProgressBar)findViewById(R.id.progressbar);//进度条
        webView = (WebView) findViewById(R.id.webview);
        webView.loadUrl("http://192.168.26.192:8080/#/");
        WebView.setWebContentsDebuggingEnabled(true);
        webView.setWebChromeClient(webChromeClient);
        webView.setWebViewClient(webViewClient);
        WebSettings webSettings=webView.getSettings();
        webSettings.setJavaScriptEnabled(true);//允许使用js
    }
}
